package com.icard.wx.icardwx.controller;

import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;

import javax.servlet.http.HttpServletRequest;

public abstract class BaseController {

    @ModelAttribute
    protected void attributes(HttpServletRequest request, ModelMap model)
    {
        String base = request.getContextPath();
        model.addAttribute("ctx", base);
        model.addAttribute("static", base + "/static");
        model.addAttribute("system_js", base + "/static/system/js");
        model.addAttribute("system_css", base + "/static/system/css");
        model.addAttribute("system_images", base + "/static/system/images");
        model.addAttribute("plugins", base + "/static/plugins");

        model.addAttribute("cssVersion", "1.33");

    }
}
